package com.siteseat.common.json;

import java.io.IOException;

import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.DeserializationContext;
import org.codehaus.jackson.map.deser.StdDeserializer;

import com.siteseat.common.entity.ValueType;

public class ValueTypeDeserializer extends StdDeserializer<ValueType> {

  /**
   * 
   */
  public ValueTypeDeserializer() {
    super( ValueType.class );
  }

  /**
   * {@inheritDoc}
   */
  @Override
  public ValueType deserialize( JsonParser jp, DeserializationContext ctxt ) throws IOException,
          JsonProcessingException {
    return ValueType.parse( jp.getText() );
  }

}
